package com.reform.mapper;

import com.reform.pojo.phase.BatchName;
import com.reform.pojo.phase.ViewBatchPhase;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * VIEW Mapper 接口
 * </p>
 *
 * @author mortale
 * @since 2021-09-12
 */
@Mapper
public interface ViewBatchPhaseMapper extends BaseMapper<ViewBatchPhase> {

    @Select("SELECT\n" +
            "view_batch_phase.batch_name AS batchName,\n" +
            "view_batch_phase.batch_id AS batchId" +
            "\n" +
            "FROM\n" +
            "view_batch_phase\n" +
            "WHERE\n" +
            "view_batch_phase.phase_id = #{phaseId}")
    List<BatchName> getBatchNameByPhaseId(@Param("phaseId") String phaseId);
}
